<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/js/datepicker/datepicker.css" rel="stylesheet">
    <link href="/styles/wendaDetail.css" rel="stylesheet" type="text/css">
    <script src="/js/jquery-2.1.4.min.js"></script>

    <link href="/styles/strategyDetail.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>

</head>
<script>
    $(function () {
        var wendaId = $('#wendaId').val();
        // 回复提交
        $('._j_submit_answer_btn').click(function () {
            var data = new Object();
            data.wendaId = wendaId;
            data.content = $('#content').val();
            $.post('/wendaDetail/commentAdd', data, function (data) {
                if (data.success) {
                    window.location.reload();
                } else {
                    alert(data.msg);
                    window.location.href="/login.html";
                }
            });
        });

        // 关注问答的提交
        $('._j_same_question').click(function () {
            $.get('/wendaDetail/favor', {wendaId: wendaId} , function (data) {
                if (data.success) {
                    $('._j_same_question').attr("class","btn-answer _j_same_question");
                    $('._j_same_question').text("关注");
                    $('._j_same_num').text(data.data);
                    alert("关注成功");
                } else {
                    $('._j_same_question').text("关注");
                    $('._j_same_question').attr("class","btn-atten _j_same_question");
                    $('._j_same_num').text(data.data);
                    alert(data.msg);
                }
            });
        });


        //评论
        $("._j_btn_goanswer").click(function () {
            $("#content").focus();
        })
    });
</script>
<body style="position: relative;">
<#include "community_head.ftl">
<br>
<br>
<br>
    <div class="detail-wrap clearfix">
        <div class="col-main">
            <input type="hidden" id="wendaId" value="${wenda.id!}"/>
            <div class="q-detail">
                <div class="q-content">
                    <div class="q-title">
                        <a href="/destination/guide?id=${wenda.destId!1}" target="_blank" class="location"><i></i>${wenda.destName!"全球"}</a>
                        <h1>
                            <a href="/destination/guide?id=${wenda.destId!1}">${wenda.title!}</a>
                        </h1>
                    </div>
                    <div class="q-desc">
                        ${wenda.content!}
                        <div class="q-info1 clearfix">
                            <div class="q-tags fl">
                                <a class="a-tag" href="/destination/guide?id=${wenda.destId!1}" target="_blank">${wenda.destName!"全球"}</a>
                            </div>
                            <div class="pub-bar fr">
                                <a href="/mine/home" class="photo" target="_blank"> <img
                                            src="${wenda.headImgUrl!
                                            "http://p2-q.mafengwo.net/s11/M00/E3/3A/wKgBEFt2Y-OANcdtAAArsdI_WDQ21.jpeg?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90"
                                            }"
                                            width="16" height="16"></a>
                                <a class="name" href="/mine/home"
                                   target="_blank">${wenda.username!}</a>
                                <span class="time"><span>${(wenda.createTime)?string('yyyy-MM-dd hh:mm:ss')}</span></span>
                            </div>
                        </div>
                    </div>
                    <div class="q-operate clearfix">
                        <div class="fl">
                            <!-- 问题分享 -->
                            <div class="q-share cate-share">
                                <a class="_js_showShare"><i class="q-share-icon"></i>分享</a>
                                <div class="share-pop _j_share_pop hide clearfix" data-title="为什么说在北京通勤等于取经？上下班到底有多苦？"
                                     data-qid="18458675">
                                    <a title="分享到新浪微博" class="sina _j_do_share" data-site="wb"></a>
                                    <a title="分享到QQ空间" class="zone _j_do_share" data-site="qz"></a>
                                    <a title="分享到微信" class="weixin _j_do_share_wx" data-site="wx"></a>
                                </div>
                            </div>
                            <!-- 邀请回答 -->
                            <div class="seek-help _j_tip_box">
                                <a class="_j_seek_help_new">邀请蜂蜂回答</a>
                            </div>
                            <!-- 举报 -->
                            <div class="admin_hide tip-off">
                                <a data-japp="report" data-refer="http://www.mafengwo.cn/wenda/detail-18458675.html"
                                   data-refer-uid="43303516" data-app="qa.question" data-busi-id="qid:18458675">举报</a>
                            </div>
                        </div>
                        <div class="fr">
                            <span class="atten-num">${wenda.viewnum!0}浏览</span>
                            <span class="atten-num"><span class="_j_same_num">${wenda.interesnum!0}</span>人关注</span>

                            <a class="${(isFollow?string('btn-answer ','btn-atten '))!}  btn-atten _j_same_question" rel="nofollow" data-status="1"><span>关注</span></a>

                            <a class="btn-answer _j_btn_goanswer" rel="nofollow">回答</a>
                        </div>
                    </div>
                </div>
                <!-- 回答 -->
                <div class="answer-wrap">
                    <div class="hd">
                        <big style="color: #2a62bc">全部共有&nbsp;${answernum!0}&nbsp;个回答</big>
                        <div style="display:none;"><span id="_j_anum"></span>${answernum!0}个回答</div>
                    </div>
                    <div class="bd _j_pager_box">
                        <ul class="answer-list answer_detail">
                            <div id="contents">
                                <#list answers as answer>
                                <li>
                                    <div class="answer-side _js_answerAva">
                                        <!-- <a class="btn-ding _js_zan "><i></i><span data-real_num="3">3</span></a> &ndash;&gt; -->
                                    </div>
                                    <div class="answer-content _js_answer_content">
                                        <div class="answer-info clearfix">
                                            <div class="user-bar fl">
                                                <a class="_j_filter_click avatar" href="/mine/home"
                                                   target="_blank"><img
                                                            src="${answer.headUrl!"http://n1-q.mafengwo.net/s12/M00/35/98/wKgED1uqIreAU9QZAAAXHQMBZ74008.png?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90"}"
                                                            width="48" height="48" class="photo"></a>
                                                <a class="name" href="/mine/home" target="_blank">${answer.username!}</a>
                                                <a class="level" href="/mine/home" target="_blank" rel="nofollow">LV.${answer.level!0}</a>
                                                <a class="identity i-guide" href="/mine/home" target="_blank">指路人</a>
                                            </div>
                                            <#if answer.goldAnswer == 1>
                                                <ul class="answer-medal fr">
                                                    <li class="gold">
                                                        <div class="btn"><i></i><a href="javascript:;"
                                                                                   target="_blank">金牌回答</a></div>
                                                    </li>
                                                </ul>
                                            </#if>
                                        </div>
                                        <!-- 回答内容 -->
                                        <div class="_j_short_answer_item hide" style="display: block;">
                                            ${answer.content!}
                                        </div>
                                    </div>
                                </#list>
                            </div>
                        </ul>
                    </div>

                    <!-- 回复 -->
                    <div class="bd _j_pager_box">
                        <div class="aa-hd">
                            <a class="aa-avatar" href="/wenda/u/53383161/answer.html"><img
                                        src="${(userInfo.headImgUrl)!
                                        "http://n1-q.mafengwo.net/s12/M00/35/98/wKgED1uqIreAU9QZAAAXHQMBZ74008.png?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90"
                                        }"
                                       width="50px" height="50px" class="photo"></a>
                            <a class="aa-name">${(userInfo.nickname)!"游客"}</a>
                        </div>
                        <div class="editor-outer _j_editorOuter _js_editorWrap _js_forFixTitle">
                            <textarea id="content"></textarea>
                        </div>
                        <div class="aa-ft">
                            <input class="btn-comment _j_submit_answer_btn" type="button" value="提交回答"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-side"></div>
        </div>
    </div>
</body>

</html>